package com.lax.advertmgt.controller;

import com.lax.advertmgt.api.TestService;
import com.lax.advertmgt.bean.UserEntity;
import com.lax.advertserver.bean.sys.RoleInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

@RestController
@RequestMapping("/mgt")
public class TestController {

    /*@Autowired
    private RestTemplate restTemplate;

    @Autowired
    private TestService testService;

    *//**
     * 测试远程服务调用
     *
     * @return
     *//*
    @GetMapping("/getOneUser")
    public UserEntity findOneUser() {
        //第一个参数是请求地址，第二个参数是返回的数据类型
        ResponseEntity<UserEntity> responseEntity = restTemplate.getForEntity(
                "http://advert-server/getUser", UserEntity.class
        );
        return responseEntity.getBody();
    }

    @GetMapping("/getOneUser1")
    public RoleInfo findOneUser1() {
        return testService.findAllUser();
    }*/
}